package com.example.springbootdemo.factory.factorymethor;

/**
 * @author ：cici
 * @date ：Created in 2019/3/12 11:10
 */
public class NvWa {

    public static void main(String[] args) {

        AbstractHumanFactory factory = new HumanFactory();
        System.out.println("---white----");
        Human white = factory.createHuman(WhiteHuman.class);
        white.getColor();
        white.talk();

        System.out.println("---black----");
        Human black = factory.createHuman(BlackHuman.class);
        black.getColor();
        black.talk();

        System.out.println("---yellow----");
        Human yellow = factory.createHuman(YellowHuman.class);
        yellow.getColor();
        yellow.talk();

    }
}
